package cn.qfei.adreport.enums;

import cn.hutool.core.util.StrUtil;

/**
 * @author li
 */
@SuppressWarnings("all")
public enum AccountRoleEnum {
    ADVERTISER("ADVERTISER", "广告主"),
    CUSTOMER_ADMIN("CUSTOMER_ADMIN", "管理员授权的纵横组织"),
    CUSTOMER_OPERATOR("CUSTOMER_OPERATOR", "协作者授权的纵横组织"),
    AGENT("AGENT", "代理商"),
    CHILD_AGENT("CHILD_AGENT", "二级代理商"),
    PLATFORM_ROLE_STAR("PLATFORM_ROLE_STAR", "星图客户"),
    PLATFORM_ROLE_STAR_AGENT("PLATFORM_ROLE_STAR_AGENT", "星图代理商"),
    PLATFORM_ROLE_AWEME("PLATFORM_ROLE_AWEME", "抖音号"),
    PLATFORM_ROLE_STAR_MCN("PLATFORM_ROLE_STAR_MCN", "星图MCN");

    private String code;

    private String desc;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    AccountRoleEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public static String getDesc(String code) {
        if (!StrUtil.isBlank(code)) {
            for (AccountRoleEnum ac : AccountRoleEnum.values()) {
                if (ac.getCode().equals(code)) {
                    return ac.getDesc();
                }
            }
        }
        return null;
    }
}
